var bgColor = "#FFFFFF";
var bgImage = "interface/imagens/loader_medio.gif";
var bgRepeat = "no-repeat";
var bgPosition = "center center";
var borderWidth = "0px";
var borderStyle = "solid";
var borderColor = "#000000";
//
var loadImage = function(w, h, url, target) {
	var img = new Image(w, h);
	img.src = url;
	img.style.visibility = "hidden";
	var molde = document.createElement("div");
	molde.setAttribute("id", "molde");
	var style = molde.style;
	style.background = bgColor+" url("+bgImage+") "+bgRepeat+" "+bgPosition;
	style.width = img.width+"px";
	style.height = img.height+"px";
	document.getElementById(target).appendChild(molde);
	molde.appendChild(img);
	img.onload = function() {
		this.style.visibility = "visible";
		molde.style.background = bgColor;
	}
}